package com.xxx.mch.feign;

import com.xxx.mch.domain.dto.UserDto;
import com.xxx.mch.domain.po.Department;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(url = "${hive.url}",name="sobyHive", configuration = FeignConfiguration.class)
public interface HiveFeignClient
{

    @GetMapping(value = "/sobeyhive-fp/v1/kernel/configs/organization/{organizationCode}/subsidiaries", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
    List<Department> getSubOrganization(@PathVariable String organizationCode);

    @GetMapping(value = "/sobeyhive-fp/v1/kernel/configs/organization/{organizationCode}/user", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
    UserDto getUserByOrganization(@PathVariable String organizationCode,  @RequestParam("size") Integer size);

    @GetMapping(value = "/sobeyhive-fp/v1/kernel/configs/organization/{organizationCode}/user", produces = MediaType.APPLICATION_JSON_VALUE, consumes = MediaType.APPLICATION_JSON_VALUE)
    UserDto getUserByOrganization(@PathVariable String organizationCode);
}
